import de.danielbechler.diff.ObjectDiffer;
import de.danielbechler.diff.ObjectDifferFactory;
import de.danielbechler.diff.node.Node;


public class App {
	public static void main(String[] args){
		Model m1 = new Model(1,"test","vvvvvv");
		m1.getList().add("dell");
		m1.getList().add("lenovo");
		m1.getList().add("hp");
		Model m2 = new Model(90,"","tttttttttttt");
		m2.setAd("doubleclick");
		m2.setStr(null);
		m2.getList().add("lenovo");
		m2.getList().add("ibm");
		ObjectDiffer objectDiffer = ObjectDifferFactory.getInstance();
		Node root = objectDiffer.compare(m2, m1);
		//root.visitChildren(new PrintingVisitor(m2, m1));
		System.out.println("==============");
		Visitor visitor = new Visitor(m2, m1);
		root.visitChildren(visitor);
		System.out.println(visitor.getChange());
	}
	
	public void test(){
		Model m1 = new Model(1,"test","vvvvvv");
		m1.getList().add("dell");
		m1.getList().add("lenovo");
		m1.getList().add("hp");
		Model m2 = new Model(90,"","tttttttttttt");
		m2.setAd("doubleclick");
		m2.setStr(null);
		m2.getList().add("lenovo");
		m2.getList().add("ibm");
		ObjectDiffer objectDiffer = ObjectDifferFactory.getInstance();
		Node root = objectDiffer.compare(m2, m1);
		//root.visitChildren(new PrintingVisitor(m2, m1));
		System.out.println("==============");
		Visitor visitor = new Visitor(m2, m1);
		root.visitChildren(visitor);
		System.out.println(visitor.getChange());
	}
}
